#ifndef MYENEMIES_H
#define MYENEMIES_H

#include "MyEnemy.h"
#include "MyDefinitions.h"

class MyEnemy;
class MyGame;

/*! 
 *  \struct enemyType
 *  \brief holds info about different enemy types
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
struct enemyType {
	int exp, life, dmg, phase_count, cash_for_kill, w, h, code;	
	double speed_constant;
	//default enemy behaviour
	int behaviour, movementPause, shotPause, getToDist, shootingWhat;
	int shot_emerge_x_l, shot_emerge_y_l, shot_emerge_x_r, shot_emerge_y_r;
	int phaseCountMove, phaseDurationMove;
	int phaseCountStand, phaseDurationStand;
	int phaseCountShoot, phaseDurationShoot;
	int phaseCountDie, phaseDurationDie;
};

/*! 
 *  \class MyEnemies
 *  \brief Class to handle all the enemies in the game, adding, moving, storing the sprite sheets, etc.
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
class MyEnemies{
	public:		
		MyEnemies(MyGame* parent);
		~MyEnemies();
		
		/*! enemy sprites */
		SDL_Surface *enemySheet[E_COUNT];	
		MyGame* parent;						

    /*! //array of enemy types */
		enemyType* enemyTypeArray;		
		
		/*! all enemies are in this list */	
		std::list <MyEnemy> enemySwarm;

    /*! load images for enemies sprites */ 
		void load_imgs();					
		/*! free all resources used by this class - unload all images, etc */
 		void clean_enemies();				
 		/*! resets everything to default state */
		void reset_enemies();		
		/*! add new enemy of type on position [x,y] */
		void add_enemy(double x, double y, int type);		
		/*! draw all enemies on the screen */	
		void draw_enemies(int _t);				
		/*! init enemies - set their sprites and attributes */
		void init_enemies();
		/*! handles the generation of new groups of enemies */
		void generate_enemy_group(int _t); 
		
		int someoneShot, enemySpawnLevel; 
	private:		
    /*! flag for correct deinit */
		bool wasInit;			
		int enemyUpdateCount;
		Uint32 lastUpdate;
};
#endif
